package cboard

import (
	"context"
	"fyne.io/fyne/v2/data/binding"
	"golang.design/x/clipboard"
)

func Do(v binding.ExternalStringList) {
	err := clipboard.Init()
	if err != nil {
		panic(err)
	}

	ch := clipboard.Watch(context.TODO(), clipboard.FmtText)
	for data := range ch {
		// print out clipboard data whenever it is changed
		//println(string(data))
		v.Append(string(data))
	}

}
